<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>${TITLE}</title>
<link rel="stylesheet" href="${path}/bootstrap/css/bootstrap.min.css" />
<script src="${path}/bootstrap/js/jquery-3.4.1.min.js"></script>
<script src="${path}/bootstrap/js/bootstrap.min.js"></script>
</head>
<body>
	<br>
	<div class="container-fluid">
		<div class="row col-md-8">
			<h3>商品信息查看</h3>
		</div>
		<div class="row">
			<div class="col-offset-md-8 col-md-4">
				<button type="button" class="btn btn-primary" id="insertBtn">插入</button>
				<button type="button" class="btn btn-danger" onclick="deleteAll()">批量删除</button>
			</div>
		</div>
		<br>
		<div class="row">
			<div class="col-md-12">
				<table id="info" class="table table-hover">
					<tr>
						<td><input type="checkbox" id="selectAll" onclick="selectAll()" />&nbsp;&nbsp;编号</td>
						<td>商品名</td>
						<td>商品价格</td>
						<td>生产日期</td>
						<td>生产厂商</td>
						<td>操作</td>
					</tr>
					<c:forEach items="${page.list}" var="e">
						<tr>
							<td>
								<input type="checkbox" value="${e.id}" class="checkSelector" />&nbsp;
								<span>${e.id}</span>
							</td>
							<td>${e.name}</td>
							<td>${e.price}</td>
							<td><fmt:formatDate value="${e.producetime}"
									pattern="yyyy-MM-dd HH:mm:ss" /></td>
							<td>${e.madefactory}</td>
							<td>
								<button type="button" class="btn btn-primary btn-sm"
									data-toggle="modal" data-target="#updateModal"
									onclick="valuesupdate('${e.id}',
									'${e.name}',
									'${e.price}',
									'<fmt:formatDate value="${e.producetime}"
									pattern="yyyy-MM-dd HH:mm:ss" />',
									'${e.madefactory}',
									'${page.pageNum}')">修改</button>&nbsp;&nbsp;
								<button type="button" class="btn btn-danger btn-sm"
									data-toggle="modal" data-target="#deleteModal"
									onclick="values('${e.id}',
									'${e.name}',
									'${e.price}',
									'<fmt:formatDate value="${e.producetime}"
									pattern="yyyy-MM-dd HH:mm:ss" />',
									'${e.madefactory}',
									'${page.pageNum}')">删除</button>
							</td>
						</tr>
					</c:forEach>
				</table>
			</div>
		</div>
	</div>
	<div class="row">
		<%@ include file="navigation.jsp"%>
	</div>
	<%@ include file="deleteModal.jsp"%>
	<%@ include file="insertModal.jsp"%>
	<%@ include file="updateModal.jsp"%>
</body>
</html>